package com.happy.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.happy.entity.CategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author: Wuzh
 * @Description:
 * @Date Created in 15:31 2021/1/23
 * @return
 */
@Mapper
public interface CategoryMapper extends BaseMapper<CategoryEntity> {

    @Select (value = "select ci.id,ci.categoryName,ci.parentId,cate.categoryName AS parentName,ci.createTime,ci.isUsed from category_info ci left join category_info cate on ci.parentId=cate.id")
    List<CategoryEntity> queryList ();

}
